﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.Configuration;

public partial class admin_administrators : System.Web.UI.Page
{
    DBControl conDB = new DBControl(WebConfigurationManager.ConnectionStrings["TestBase"].ConnectionString);
 
    protected void Page_Load(object sender, EventArgs e)
    {
        ListAllUsers.ShowFooter = false;
        Attempt.Visible = false;
        Discard.Visible = false;
        New.Visible = true;
    }
    protected void AddUser(object sender, CommandEventArgs e) {
        ListAllUsers.ShowFooter = true;
        Attempt.Visible = true;
        Discard.Visible = true;
        New.Visible = false;
    }
    protected void Insert(object sender, CommandEventArgs e)
    {
        ListAllUsers.ShowFooter = false;
        Attempt.Visible = false;
        Discard.Visible = false;
        New.Visible = true;
        conDB.InsertUser(Request.Form[((TextBox)ListAllUsers.FooterRow.FindControl("TextBox1")).UniqueID], Request.Form[((TextBox)ListAllUsers.FooterRow.FindControl("TextBox2")).UniqueID]);
    }
    protected void Cancel(object sender, CommandEventArgs e)
    {
        ListAllUsers.ShowFooter = false;
        Attempt.Visible = false;
        Discard.Visible = false;
        New.Visible = true;
    }
}
